//part1:C03:ex3.40.cpp -- concat two strings, then copy them to next array.
#include <iostream>
#include <cstring>

int main(void)
{
    using namespace std;
    char str1[] = "Welcome to ";
    char str2[] = "C++!";

    char result[strlen(str1) + strlen(str2) - 1];
    strcpy(result, str1);
    strcat(result, str2);

    cout << "str1 is: " << str1 << endl;
    cout << "str2 is: " << str2 << endl;
    cout << "concat str is: " << result << endl;

    return 0;
}
